package com.hy.properties;

import com.hy.properties.config.MainConfig;
import com.hy.properties.prop.HyProperties;
import com.hy.properties.prop.MemberProperties;
import com.hy.properties.prop.OtherMember;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

/**
 * Created With IntelliJ IDEA.
 * Descriptions:
 * author: Mr.Du
 * Date: 2023/6/28
 * Time: 17:41
 */
@SpringBootApplication
@Slf4j
@RequiredArgsConstructor
@ConfigurationPropertiesScan
public class TestPropertiesApplication {
    
    private final OtherMember otherMember;
    
    private final MemberProperties memberProperties;
    
    private final HyProperties hyProperties;
    
    public static void main(String[] args) {
        SpringApplication.run(TestPropertiesApplication.class, args);
    }
    
    @Bean
    public CommandLineRunner commandLineRunner() {
        return (args) -> {
            log.info("otherMember properties: {}", otherMember);
            log.info("memberProperties properties: {}", memberProperties);
            log.info("hyProperties properties: {}", hyProperties);
        };
    }
}
